package practice06;

public class Teacher extends Person{
    private int klass;


    public Teacher(String name, int age, int klass) {
        super(name, age);
        this.klass = klass;
    }

    public Teacher(String name, int age) {
        super(name, age);
    }

    public int getKlass() {
        return klass;
    }

    public void setKlass(int klass) {
        this.klass = klass;
    }

    public String introduce(){
        Person person = new Person(this.getName(),this.getAge());
        if(this.klass==0){
            return person.introduce()+" I am a Teacher. I teach No Class.";
        }else {
            return person.introduce()+" I am a Teacher. I teach Class "+klass+".";
        }

    }
}
